package com.cmas.platform.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import com.aidex.common.core.domain.BasePlusEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aidex.common.utils.log.annotation.FieldRemark;
import com.aidex.common.utils.log.annotation.LogField;
import com.aidex.common.annotation.Excel;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 帖子管理对象 post
 * @author su
 * @email 1218819874@qq.com
 * @date 2023-03-15
 */
@Data
public class Post extends BasePlusEntity
{
    private static final long serialVersionUID = 1L;

    /** 用户ID */
    @Excel(name = "用户ID")
    @LogField
    @FieldRemark(name = "用户ID",field = "userId")
    @NotBlank(message = "用户不允许为空")
    private String userId;

    /** 地区ID */
    @Excel(name = "地区ID")
    @LogField
    @FieldRemark(name = "地区ID",field = "regionId")
    @NotBlank(message = "地区不允许为空")
    private String regionId;

    /** 版块ID */
    @Excel(name = "版块ID")
    @LogField
    @FieldRemark(name = "版块ID",field = "sectionId")
    @NotBlank(message = "版块不允许为空")
    private String sectionId;

    /** 帖子标题 */
    @Excel(name = "帖子标题")
    @LogField
    @FieldRemark(name = "帖子标题",field = "title")
    @NotBlank(message = "帖子标题不允许为空")
    @Size(max = 128, message = "帖子标题长度不能超过128个字符")
    private String title;

    /** 帖子内容 */
    @Excel(name = "帖子内容")
    @LogField
    @FieldRemark(name = "帖子内容",field = "content")
    @NotBlank(message = "帖子内容不允许为空")
    private String content;

    /** 帖子封面 */
    @Excel(name = "帖子封面")
    @LogField
    @FieldRemark(name = "帖子封面",field = "image")
    private String image;

    /** 帖子联系人 */
    @Excel(name = "帖子联系人")
    @LogField
    @FieldRemark(name = "帖子联系人",field = "contact")
    private String contact;

    /** 帖子联系电话 */
    @Excel(name = "帖子联系电话")
    @LogField
    @FieldRemark(name = "帖子联系电话",field = "phone")
    private String phone;

    /** 帖子地址 */
    @LogField
    @FieldRemark(name = "帖子地址",field = "address")
    private String address;

    /** 帖子是否匿名 */
    @LogField
    @FieldRemark(name = "帖子是否匿名",field = "anonymity")
    private String anonymity;

    /** 帖子类型 */
    @LogField
    @FieldRemark(name = "帖子类型",field = "type")
    @NotBlank(message = "帖子类型不允许为空")
    private String type;

    /** 帖子发布时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @LogField
    @FieldRemark(name = "帖子发布时间",field = "publishTime")
    private Date publishTime;

    /** 帖子修改时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @LogField
    @FieldRemark(name = "帖子修改时间",field = "editTime")
    private Date editTime;

	
    /** 帖子点赞数 */
    @LogField
    @FieldRemark(name = "帖子点赞数",field = "likeNumber")
    private Integer likeNumber;

    /** 帖子收藏数 */
    @LogField
    @FieldRemark(name = "帖子收藏数",field = "collectNumber")
    private Integer collectNumber;

    /** 帖子回复数 */
    @LogField
    @FieldRemark(name = "帖子回复数",field = "replyNumber")
    private Integer replyNumber;

    /** 帖子浏览数 */
    @LogField
    @FieldRemark(name = "帖子浏览数",field = "viewNumber")
    private Long viewNumber;

    /** 帖子举报数 */
    @LogField
    @FieldRemark(name = "帖子举报数",field = "reportNumber")
    private Integer reportNumber;

    /** 帖子状态 */
    @LogField
    @FieldRemark(name = "帖子状态",field = "status")
    @TableField(value = "status", fill = FieldFill.INSERT)
    private String status;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("userId", getUserId())
            .append("regionId", getRegionId())
            .append("sectionId", getSectionId())
            .append("title", getTitle())
            .append("content", getContent())
            .append("image", getImage())
            .append("contact", getContact())
            .append("phone", getPhone())
            .append("address", getAddress())
            .append("anonymity", getAnonymity())
            .append("type", getType())
            .append("publishTime", getPublishTime())
            .append("editTime", getEditTime())
            .append("likeNumber", getLikeNumber())
            .append("collectNumber", getCollectNumber())
            .append("replyNumber", getReplyNumber())
            .append("viewNumber", getViewNumber())
            .append("reportNumber", getReportNumber())
            .append("status", getStatus())
            .append("remark", getRemark())
            .append("id", getId())
            .append("createBy", getCreateBy())
            .append("createDept", getCreateDept())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("updateIp", getUpdateIp())
            .append("version", getVersion())
            .append("delFlag", getDelFlag())
            .toString();
    }
}
